$.ajaxPrefilter(function (options) {
  options.url = 'http://www.liulongbin.top:3008' + options.url
  // 判断请求的url地址中是否有my字符串
  if (options.url.includes('/my/')) {
    options.headers = {
      Authorization: localStorage.getItem('token') || '',
    }
  }
  options.complete = function (res) {
    if (res.responseJSON.code === 1 && res.responseJSON.message === '身份认证失败！') {
      localStorage.removeItem('token')
      location.href = '/login.html'
    }
  }
})
